
<template>
  <el-dialog v-model="dialogData.visible" title="新增/编辑" @close="cancel">
    <p>新增/编辑modal测试</p>
    <p>新增/编辑modal测试</p>
    <p>新增/编辑modal测试</p>
    <h1>hey</h1>
  </el-dialog>
</template>
<script lang="ts">
import { defineComponent, reactive, ref } from 'vue'
export default defineComponent({
  name: 'operatedialog',
  emits: ['cancel'],
  props: {
    dialogData: {
      type: Object,
      default: {
        visible: false,
        data: {}
      }
    }
  },
  setup(props, ctx) {
    // const visible = ref<boolean>(false)
    // const showModal = () => {
    //   // visible.value = true
    // }
    const handleOk = (e: MouseEvent) => {
      console.log(e)
      // visible.value = false
    }
    const cancel = (e: MouseEvent) => {
      console.log(e)
      ctx.emit('cancel');
      // visible.value = false
    }
    console.log('dialogData.data', props.dialogData.data)

    const modalData = reactive(props.dialogData.data)

    


    return {
      // showModal,
      handleOk,
      cancel,
      modalData
    }

  }
})
</script>

<style lang="scss" scoped>
</style>
